
package sismatriculas;

import Propiedades.Propiedades;
import java.util.Properties;

public class frmPrincipal_plantilla extends javax.swing.JFrame {

    frmUsuariosSistema internal1;
    frmInternal2 internal2;

    public frmPrincipal_plantilla() {
        //this.setResizable(false);
        initComponents();
        menuEspanol.setSelected(true);
        this.setExtendedState(MAXIMIZED_BOTH);
        internal1 = new frmUsuariosSistema();
        internal2 = new frmInternal2();
    }

    public void CargarIdiomaPincipal(String idioma) {
        Properties propiedades = new Propiedades(idioma);
        //Titulo del frame
        this.setTitle(propiedades.getProperty("Titulo") + " by Contre17");
        //Barra de menu
        menuArchivo.setText(propiedades.getProperty("Archivo"));
        editMenu.setText(propiedades.getProperty("Edicion"));
        menuIdioma.setText(propiedades.getProperty("Idioma"));
        helpMenu.setText(propiedades.getProperty("Ayuda"));
        openMenuItem.setText(propiedades.getProperty("AbrirArchiv"));
        saveMenuItem.setText(propiedades.getProperty("Guardar"));
        saveAsMenuItem.setText(propiedades.getProperty("GuardarTodo"));
        exitMenuItem.setText(propiedades.getProperty("Salir"));
        cutMenuItem.setText(propiedades.getProperty("Cortar"));
        copyMenuItem.setText(propiedades.getProperty("Copiar"));
        pasteMenuItem.setText(propiedades.getProperty("Pegar"));
        deleteMenuItem.setText(propiedades.getProperty("Eliminar"));
        menuIngles.setText(propiedades.getProperty("Ingles"));
        menuEspanol.setText(propiedades.getProperty("Espanol"));
        aboutMenuItem.setText(propiedades.getProperty("Acerca") + "...");
        btnInternal1.setText(propiedades.getProperty("DatoPersonal"));
        btnInternal2.setText(propiedades.getProperty("Cargar"));
        btnComentar.setText(propiedades.getProperty("Comentar") + "...");
        menuVer.setText(propiedades.getProperty("Ver"));
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        desktopPane = new javax.swing.JDesktopPane();
        jToolBar1 = new javax.swing.JToolBar();
        btnInternal1 = new javax.swing.JButton();
        btnInternal2 = new javax.swing.JButton();
        btnComentar = new javax.swing.JButton();
        menuBar = new javax.swing.JMenuBar();
        menuArchivo = new javax.swing.JMenu();
        openMenuItem = new javax.swing.JMenuItem();
        saveMenuItem = new javax.swing.JMenuItem();
        saveAsMenuItem = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        exitMenuItem = new javax.swing.JMenuItem();
        editMenu = new javax.swing.JMenu();
        cutMenuItem = new javax.swing.JMenuItem();
        copyMenuItem = new javax.swing.JMenuItem();
        pasteMenuItem = new javax.swing.JMenuItem();
        deleteMenuItem = new javax.swing.JMenuItem();
        menuVer = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        menuIdioma = new javax.swing.JMenu();
        menuEspanol = new javax.swing.JRadioButtonMenuItem();
        menuIngles = new javax.swing.JRadioButtonMenuItem();
        helpMenu = new javax.swing.JMenu();
        aboutMenuItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle(".:: Sistema de Matriculas y Notas ::.");

        desktopPane.setBackground(new java.awt.Color(153, 153, 153));

        jToolBar1.setBackground(new java.awt.Color(153, 204, 255));
        jToolBar1.setRollover(true);

        btnInternal1.setText("usuarios");
        btnInternal1.setFocusable(false);
        btnInternal1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnInternal1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnInternal1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnInternal1ActionPerformed(evt);
            }
        });
        jToolBar1.add(btnInternal1);

        btnInternal2.setText("jButton2");
        btnInternal2.setFocusable(false);
        btnInternal2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnInternal2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnInternal2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnInternal2ActionPerformed(evt);
            }
        });
        jToolBar1.add(btnInternal2);

        btnComentar.setText("jButton1");
        btnComentar.setFocusable(false);
        btnComentar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnComentar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnComentar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnComentarActionPerformed(evt);
            }
        });
        jToolBar1.add(btnComentar);

        menuArchivo.setText("Archivo");

        openMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/openFile1.png"))); // NOI18N
        openMenuItem.setText("Abrir");
        menuArchivo.add(openMenuItem);

        saveMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Save1.png"))); // NOI18N
        saveMenuItem.setText("Guardar");
        menuArchivo.add(saveMenuItem);

        saveAsMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/SaveAll1.png"))); // NOI18N
        saveAsMenuItem.setText("Guardar como...");
        menuArchivo.add(saveAsMenuItem);
        menuArchivo.add(jSeparator1);

        exitMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Exit1.png"))); // NOI18N
        exitMenuItem.setText("Exit");
        exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuItemActionPerformed(evt);
            }
        });
        menuArchivo.add(exitMenuItem);

        menuBar.add(menuArchivo);

        editMenu.setText("Editar");

        cutMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Cut1.png"))); // NOI18N
        cutMenuItem.setText("Cortar");
        editMenu.add(cutMenuItem);

        copyMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Copy1.png"))); // NOI18N
        copyMenuItem.setText("Copiar");
        editMenu.add(copyMenuItem);

        pasteMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Paste1.png"))); // NOI18N
        pasteMenuItem.setText("Pegar");
        editMenu.add(pasteMenuItem);

        deleteMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/Delete1.png"))); // NOI18N
        deleteMenuItem.setText("Eliminar");
        editMenu.add(deleteMenuItem);

        menuBar.add(editMenu);

        menuVer.setText("Ver");

        jMenuItem1.setText("Barra de Erramientas");
        menuVer.add(jMenuItem1);

        menuBar.add(menuVer);

        menuIdioma.setText("Idioma");

        buttonGroup1.add(menuEspanol);
        menuEspanol.setSelected(true);
        menuEspanol.setText("Español");
        menuEspanol.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuEspanolActionPerformed(evt);
            }
        });
        menuIdioma.add(menuEspanol);

        buttonGroup1.add(menuIngles);
        menuIngles.setText("Ingles");
        menuIngles.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuInglesActionPerformed(evt);
            }
        });
        menuIdioma.add(menuIngles);

        menuBar.add(menuIdioma);

        helpMenu.setText("Ayuda");

        aboutMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Recursos/About.png"))); // NOI18N
        aboutMenuItem.setText("Ayuda");
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 790, Short.MAX_VALUE)
            .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 790, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 397, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitMenuItemActionPerformed

    private void menuEspanolActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuEspanolActionPerformed
        //CargarIdiomaPincipal("ESPANOL");
        //internal1.CargarIdioma1("ESPANOL");
        //internal2.CargarIdioma2("ESPANOL");
    }//GEN-LAST:event_menuEspanolActionPerformed

    private void menuInglesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuInglesActionPerformed
        //CargarIdiomaPincipal("INGLES");
       // internal1.CargarIdioma1("INGLES");
        //internal2.CargarIdioma2("INGLES");
    }//GEN-LAST:event_menuInglesActionPerformed

    private void btnInternal1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInternal1ActionPerformed
        desktopPane.add(internal1);
        if (internal1.isVisible() == false) {
            internal1.setVisible(true);
        }
        internal1.GenerarCod();
    }//GEN-LAST:event_btnInternal1ActionPerformed

    private void btnInternal2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInternal2ActionPerformed
        desktopPane.add(internal2);
        if (internal2.isVisible() == false) {
            internal2.setVisible(true);
        }
    }//GEN-LAST:event_btnInternal2ActionPerformed

    private void btnComentarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnComentarActionPerformed
        Runtime aplicacion = Runtime.getRuntime();
        try {
            aplicacion.exec("C:/Windows/System32/cmd.exe /K start http://myblogcontre.wordpress.com/2011/06/27/aplicacacion-multilenguaje-en-java-formulario-mdi/#respond");
        } catch (Exception e) {
        }
    }//GEN-LAST:event_btnComentarActionPerformed

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new frmPrincipal_plantilla().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem aboutMenuItem;
    private javax.swing.JButton btnComentar;
    private javax.swing.JButton btnInternal1;
    private javax.swing.JButton btnInternal2;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JMenuItem copyMenuItem;
    private javax.swing.JMenuItem cutMenuItem;
    private javax.swing.JMenuItem deleteMenuItem;
    private javax.swing.JDesktopPane desktopPane;
    private javax.swing.JMenu editMenu;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JMenu menuArchivo;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JRadioButtonMenuItem menuEspanol;
    private javax.swing.JMenu menuIdioma;
    private javax.swing.JRadioButtonMenuItem menuIngles;
    private javax.swing.JMenu menuVer;
    private javax.swing.JMenuItem openMenuItem;
    private javax.swing.JMenuItem pasteMenuItem;
    private javax.swing.JMenuItem saveAsMenuItem;
    private javax.swing.JMenuItem saveMenuItem;
    // End of variables declaration//GEN-END:variables
}
